import java.io.*;
//其实System.out是一个流对象:源码:public class PrintStream extends FilterOutputStream
//System.out.println("")其实是PrintStream.print()
public class Child {
    public static void main(String[] args) throws IOException, InterruptedException {
//        子进程获取父进程的数据
        DataInputStream dataInputStream = new DataInputStream(System.in);
        String line = dataInputStream.readUTF();
//        将子进程的数据输入到子进程的控制台
        DataOutputStream dataOutputStream = new DataOutputStream(System.out);
        dataInputStream.close();
        for (int i = 0; i < 2; i++) {
//            数据将流入当前进程的控制台也就是System.out
            dataOutputStream.writeUTF("hi" + line);
        }
        dataOutputStream.writeUTF("end");
        dataOutputStream.close();
    }
}
